#include "default_request.h"

#include <boost/lexical_cast.hpp>

#include "base/logging.h"

namespace imserver {

bool DefaultHttpRequest::Response() {
  std::string body("<html><body>您没有权限访问该页面!</body></html>");

  response_ = "HTTP/1.1 403 Forbidden\r\nContent-Type: text/html; charset=utf-8\r\nConnection: close\r\nContent-Length: ";
  response_ += boost::lexical_cast<std::string>(body.size());
  response_.append("\r\n\r\n");

  response_.append(body);
  connection_->WriteResponse(response_);
  LOG_INFO("Frobidden Request " << url_ << " addr=" << remote_addr());
  return true;
}

}

